#ifndef INPUTMANAGER_H
#define INPUTMANAGER_H

#include "KeyListener.h"
#include "MouseListener.h"
#include <list>

class InputManager
{
    public:
        static InputManager& GetInstance();
        static InputManager* GetInstancePtr();
        void AddKeyListener(KeyListener* listener);
        void RemoveKeyListener(KeyListener* listener);
        void AddMouseListener(MouseListener* listener);
        void RemoveMouseListener(MouseListener* listener);
        ~InputManager();
        bool Capture();
        SDL_Event &GetEvent(){return event;};
    protected:
    private:
        SDL_Event event;
        InputManager();
        std::list<KeyListener*> mKeyListeners;
        std::list<KeyListener*>::iterator mKeyListenersIterator;
        std::list<MouseListener*> mMouseListeners;
        std::list<MouseListener*>::iterator mMouseListenersIterator;
        static InputManager mInputManager;
};

#endif // INPUTMANAGER_H
